/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tests;

import commonpackage.Order;
import commonpackage.POI;
import java.util.ArrayList;
import util.DBManagement;

/**
 *
 * @author chuda
 */
public class Tests {

    public static void main(String[] args) {


//        try { // Call Web Service Operation
//            ws.POImanagerService service = new ws.POImanagerService();
//            ws.POImanager port = service.getPOImanagerPort();
//            // TODO initialize WS operation arguments here
//            java.lang.String keyword = "";
//            // TODO process result here
//            ArrayList<POI> result = port.GetPoisByKeyWord("coi");
//            System.out.println("Result = "+result);
//        } catch (Exception ex) {
//            ex.printStackTrace();
//            // TODO handle custom exceptions here
//        }


        POI orderpoi = null;

        DBManagement dbm = new DBManagement();
        String[] pois = dbm.selectAllPOIs();

        System.out.println(pois);
        if (pois != null) {
            for (int i = 0; i < pois.length; i++) {
                //POI poi = pois[i];
               // System.out.println(poi.getUrl());
                //if (poi.getId() == 5) {
                  //  orderpoi = poi;
                //}
            }
        } else {
            System.out.println("null");
        }
        //public Order(POI poi, String telNumber, int numPeople, String name)
        Order order = new Order(orderpoi,"23456",22,"Olga");
      //  System.out.println("result of order: "+dbm.makeOrder(order));
        System.out.println("result of cancel: "+dbm.cancelOrder(order));
        String[] orders = dbm.selectOrdersByTelNumber("23456");
        System.out.println(orders);
       // for (Order ord : orders) {
         //   System.out.println("Order's poi: " + ord.getPoi().getDescription());
        //}
    }
}
